@extends('home.seller.zhuce')

@section('content')
      <form id="registerForm" method="POST" action="/home/seller/insert" > 
        {!! csrf_field() !!}
       <h3> <a href="/home/seller/denglu">登录</a> 卖家注册美丽说 </h3> 
       <div class="reg_list"> 
        <p class="reg_box"> <input class="reg_txt" id="mobile" name="phone" type="text" placeholder="手机号" autocomplete="off" required/> <span style="color:#f69;font-size:16px">{{ $errors->first('phone') }}</span> <span class="tel_icon"></span> </p> 
        <!-- <p class="mlsUserEor red_f"></p> --> 
       </div> 
       <div class="reg_list"> 
        <p class="reg_box"> <input class="reg_txt" id="nickname" name="name" type="text" placeholder="昵称" autocomplete="off" required onblur = "return get_user()" /> <span id="hwj_name" style="color:#f69;font-size:16px"></span> <span class="user_icon"></span> </p> 
        <!-- <p class="mlsUserEor red_f"></p> --> 
       </div> 
       <div class="reg_list"> 
        <p class="reg_box"> <input class="reg_txt" id="password" name="password" type="password" placeholder="密码"  required /> <span style="color:#f69;font-size:16px">{{ $errors->first('repassword') }}</span> <span class="pwd_icon"></span> </p> 
       </div> 
       <div class="reg_list"> 
        <p class="reg_box"> <input class="reg_txt" id="password" name="repassword" type="password" placeholder="确认密码"  required /> <span style="color:#f69;font-size:16px">{{ $errors->first('password') }}</span> <span class="pwd_icon"></span> </p> 
       </div> 
  
       <div class="regErrorMessage none_f"></div> 
       <div class="reg_btn_wrap"> 
        <input type="submit" class="reg_btn" value="立即注册" /> 
       </div> 
       <div class="agree_reg"> 
        <input type="checkbox" checked="checked" id="agreement" required/>同意
        <a href="https://account.meilishuo.com/agree" target="_blank">《美丽说注册条款》</a>
        <a target="_blank" href="https://account.meilishuo.com/rule">《美丽说平台消费者规则》</a> 
       </div> 
       <script type="text/javascript">
          function get_user()
          {
           $.ajaxSetup({
            headers: {
              'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
           });
            var name = $("input[name='name']").val();

            $.post('/home/seller/checkuser',{'name':name},function(msg){
                $('#hwj_name').html(msg);
            });
          }
       </script>
      </form> 
@endsection